﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

using Web.Factories;

namespace Web.Controllers
{
    [Authorize]
    public class HomeController : BaseController
    {
        private readonly ISettingModelFactory _settingModelFactory;
        public HomeController(ISettingModelFactory settingModelFactory)
        {
            _settingModelFactory = settingModelFactory;
        }
        public override IActionResult Index()
        {
            var model = _settingModelFactory.PrepareGeneralCommonSettingsModel();
            string uitheme = GetCookies("page_layout").ToLower();
            switch (uitheme)
            {
                case "admintop":
                    return View("AdminTop", model);          // 顶部菜单版本
                case "admindefault":
                    return View("AdminDefault", model);          // 顶部菜单版本
                default:
                    return View("AdminDefault", model);     // 经典版本
            }
        }
        [HttpGet]
        public ActionResult AdminDesktop()
        {
            return View();
        }
        [HttpGet]
        public ActionResult About()
        {
            return View();
        }
    }
}